accessibility
Macromedia Logo Upper Navigation Bar
 Help
Lower Navigation Bar
ProductsSupportDesigner DeveloperDownloadsStoreInternationalSite MapCompany
Home > Products > Director > Support > TechNote Index
Macromedia Director Support Center - TechNote

Changing linked file paths

Product: Director
Platform: Mac, Win
Versions: 7.0 to above
ID: 3126
How useful was this document?
less more

1

2

3

4

5

How can the document be improved? (300 characters or less - you will not receive a reply.)

Issue
Many developers discover the problem of changing drive letters and file paths after they have pressed their first CD-ROM, only to get the dreaded "Where is..." dialog. This document will show you how to set up your CD-ROM properly, so that you will get it right the first time.

Solution

Using the searchPaths and the pathName
Director includes two very important commands regarding file paths. These commands are the searchPaths and the pathName. The searchPaths command tells Director where to look for media files, and the pathName returns the path to the current Director movie. By using these two functions, you can avoid path problems.

Many developers organize their CD-ROM with their projector on the root of the CD-ROM with the content organized in sub-directories. This provides an organized look, and is intuitive to the user, since there are only a few files to click on. This design also makes it fairly easy to tell Director where to find content files.

When Director tries to load a media file it first looks for the path that it was originally linked to, if it does not find it there it will look in the same directory or folder as your Director movie. If it still cannot find the file, it looks through the directories listed in the searchPaths. The searchPaths is a list that may be appended with many paths. So for example, lets say you have a projector on the root of your CD-ROM with linked Quicktime files located in a sub-directory called QUIKTIME. You also have sound files located in a SOUND directory. You can tell Director to search these directories with the following statement:

on startMovie
append the searchPaths, the moviePath & "quicktime"
append the searchPaths, the moviePath & "sound"
end

The append command adds this path to the current searchPaths. The next command on that line is "the pathName" which returns the path to the current movie. Since the projector is on the root of the CD-ROM this command would return "D:\" or whatever the CD-ROM drive letter is. Then we add the directory name to the pathname, so that the final path added to the searchPaths is "D:\QUIKTIME" The next line does the same thing for the sound directory. Now Director will look through these directories for linked media files.

Note: You must put these scripts in a movie that does not load any of the media files from the directories specified in the searchPaths command. For example, if your project consists of Movie1.dir and Movie2.dir, and Movie2.dir contains linked media, the searchpaths must be set in a script in Movie1.dir.. A good approach would be to have your first movie set up the searchpaths in the movie script, then in frame 1, branch to your intro or main movie using the command:

go to movie "Movie1"

If there is only one Director movie in your project, you mus
t create a new Director movie that runs first and sets the searchpaths. A stub projector can be used to accomplish this task. For information on stub projectors, see What is a stub projector? (TechNote 13530).


Last updated: January 14, 2003
Keywords: where is, searchpath, searchpaths, pathname, relative, absolute, moviepath, linked media
Created: Before June 4, 1997

©1995-2003 Macromedia, Inc. All rights reserved.
Use of this website signifies your agreement to the Terms of Use.
Privacy | Site Map
| Contact us | Accessibility | Report Piracy